Skip to content

Fix/token permissions id 20260911 - #93

Closed
hyperpolymath wants to merge 2 commits into
mainfrom
fix/token-permissions-id-20260911
Closed

hyperpolymath wants to merge 2 commits into
mainfrom
fix/token-permissions-id-20260911

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Closes #

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (would change existing behaviour)
  • 🕳️ Soundness fix (fixes a checker/proof false-negative)
  • 📖 Documentation
  • 🧹 Refactor / tech debt (behaviour-preserving)
  • ⚡ Performance
  • 🔧 Build / CI / tooling

How has this been verified?

Checklist

  • My commits are signed (git commit -S).
  • I ran the project's own checks/tests locally and they pass.
  • New files carry the correct SPDX-License-Identifier (code/config MPL-2.0,
    prose CC-BY-SA-4.0); I did not relicense existing files.
  • Docs are updated, and no public claim now overstates what the code does.
  • I have not introduced a soundness hole (or I have flagged where I might have).

Notes for reviewers

hyperpolymath and others added 2 commits September 11, 2026 11:26
- Update CodeQL workflow to SHA-pinned actions with persist-credentials: false
- Update reusable workflow pins to current standards main SHAs

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Apply principle of least privilege for GITHUB_TOKEN:
- Change top-level permissions to read-only
- Jobs inherit read permissions, can escalate as needed

This resolves Scorecard TokenPermissionsID alerts.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1ba90948-18b0-4afc-a39b-2fc4f276a4eb

📥 Commits

Reviewing files that changed from the base of the PR and between 4a9c952 and 1766c81.

📒 Files selected for processing (6)
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .github/workflows/dependabot-automerge.yml
  • .github/workflows/governance.yml
  • .github/workflows/hypatia-scan.yml
  • .github/workflows/scorecard.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath

Copy link
Copy Markdown
Owner Author

Closing this PR unlanded, as part of a decision on the whole fix/token-permissions-id-20260911 family (21 PRs). Not a rejection of least-privilege permissions — a decision to fix the generator instead of 21 branches.

Why the family is not landable

The sweep narrows contents: write to contents: read at the workflow level on workflows that genuinely write — git push, gh pr merge --auto, gh release create, create-pull-request. Where the writing job has no permissions: block of its own and authenticates with GITHUB_TOKEN, the narrowing silently removes a permission the workflow needs.

It is silent in the worst way. The diff is valid YAML and fails no check, so the PR shows green; the damage fires on the next write, which may be weeks later and in a different workflow than the one reviewed. Where the push is written git push … || echo "::warning::", a denied push emits a warning rather than a failure and the run stays green forever.

In several files the sweep rewrote the value and left the justifying comment attached to it, so the patch states its own requirement and then removes it:

 permissions:
-  contents: write # needed to enable auto-merge
+  contents: read # needed to enable auto-merge

Root cause — in the rule, not in these branches

hypatia's workflow_audit.ex:463 tests:

Regex.match?(~r/^permissions:/m, content)

anchored at column 0. A job-level permissions: block is indented, so the rule structurally cannot see it. It can therefore only ever rewrite workflow-level permissions, and cannot tell a workflow that needs the write from one that does not. The rule runs across the estate, which is why this arrived as a 21-PR family rather than one bad patch.

The estate already gets this right in three places (standards/signed-push-smoke.yml, KnotTheory.jl/release.yml, gitbot-fleet/inbox-steward.yml), all using per-job elevation — so this is generator inconsistency, not policy.

What happens instead

Nothing here is lost: the intended permissions hardening is deferred to a correct generator, not abandoned.

🤖 Generated with Claude Code

https://claude.ai/code/session_014QN8x5x4kNKY8EYCFsCmWB

@hyperpolymath
hyperpolymath deleted the fix/token-permissions-id-20260911 branch September 18, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants